Skip to content

Conversation

ardatan
Copy link
Member

@ardatan ardatan commented Mar 12, 2024

Implementation of Variable Batching;
graphql/composite-schemas-spec#25

@ardatan ardatan requested a review from kamilkisiela March 12, 2024 10:55
Copy link

changeset-bot bot commented Mar 12, 2024

🦋 Changeset detected

Latest commit: d9c4bf9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
graphql-yoga Minor
@graphql-yoga/nestjs Major
@graphql-yoga/render-graphiql Major
@graphql-yoga/plugin-apollo-inline-trace Major
@graphql-yoga/plugin-apq Major
@graphql-yoga/plugin-csrf-prevention Major
@graphql-yoga/plugin-defer-stream Major
@graphql-yoga/plugin-disable-introspection Major
@graphql-yoga/plugin-graphql-sse Major
@graphql-yoga/plugin-jwt Major
@graphql-yoga/plugin-persisted-operations Major
@graphql-yoga/plugin-prometheus Major
@graphql-yoga/plugin-response-cache Major
@graphql-yoga/plugin-sofa Major
apollo-federation-gateway-with-yoga Patch
apollo-subgraph-with-yoga Patch
graphql-lambda Patch
cloudflare-advanced Patch
cloudflare Patch
functions Patch
hackernews Patch
nextjs-app Patch
hello-world-benchmark Patch
@graphql-yoga/nestjs-federation Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Mar 12, 2024

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-yoga/apollo-link 5.1.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/urql-exchange 5.1.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
graphql-yoga 5.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/nestjs-federation 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apollo-inline-trace 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/apollo-managed-federation 0.15.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apollo-usage-report 0.11.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-apq 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-csrf-prevention 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-defer-stream 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-disable-introspection 2.17.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-graphql-sse 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-jwt 3.10.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-persisted-operations 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-prometheus 6.11.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-response-cache 3.18.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/plugin-sofa 3.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/render-apollo-sandbox 0.1.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎
@graphql-yoga/render-graphiql 5.16.0-alpha-20250916233302-d249f256b3c527b241b21f1434fcdc9e1e55b27e npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Mar 12, 2024

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

Copy link
Contributor

github-actions bot commented Mar 12, 2024

💻 Website Preview

The latest changes are available as preview in: https://pr-3198.graphql-yoga.pages.dev

Copy link
Contributor

github-actions bot commented Mar 12, 2024

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}
     ✓ no_errors{mode:uws}
     ✓ expected_result{mode:uws}

     checks.......................................: 100.00% ✓ 505950      ✗ 0     
     data_received................................: 2.0 GB  14 MB/s
     data_sent....................................: 102 MB  678 kB/s
     http_req_blocked.............................: avg=1.59µs   min=1.02µs   med=1.36µs   max=253.8µs  p(90)=2.09µs   p(95)=2.31µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=157.71µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=369.58µs min=217.38µs med=339.12µs max=15.13ms  p(90)=474.1µs  p(95)=493.87µs
       { expected_response:true }.................: avg=369.58µs min=217.38µs med=339.12µs max=15.13ms  p(90)=474.1µs  p(95)=493.87µs
     ✓ { mode:graphql-jit }.......................: avg=293.35µs min=217.38µs med=273.16µs max=14.49ms  p(90)=303.97µs p(95)=319.27µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=498.54µs min=417.67µs med=475.54µs max=7.05ms   p(90)=511.2µs  p(95)=529.77µs
     ✓ { mode:graphql-response-cache }............: avg=351.61µs min=266.59µs med=333.68µs max=12.81ms  p(90)=365.41µs p(95)=377.4µs 
     ✓ { mode:graphql }...........................: avg=373.02µs min=282.17µs med=345.32µs max=15.13ms  p(90)=397.21µs p(95)=453.44µs
     ✓ { mode:uws }...............................: avg=366.94µs min=288.86µs med=346.5µs  max=6.35ms   p(90)=379.75µs p(95)=395.86µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 252975
     http_req_receiving...........................: avg=34.72µs  min=16.64µs  med=33.85µs  max=6.03ms   p(90)=40.97µs  p(95)=44.31µs 
     http_req_sending.............................: avg=9.25µs   min=6.11µs   med=8.36µs   max=399.6µs  p(90)=11.73µs  p(95)=12.92µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=325.6µs  min=181.27µs med=297.02µs max=14.79ms  p(90)=429.35µs p(95)=447.96µs
     http_reqs....................................: 252975  1686.485256/s
     iteration_duration...........................: avg=587.8µs  min=401.94µs med=552.73µs max=15.75ms  p(90)=695.75µs p(95)=718.51µs
     iterations...................................: 252975  1686.485256/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

params: GraphQLParams | GraphQLParams[],
): GraphQLParams | GraphQLParams[] {
if (Array.isArray(params)) {
return params.map(param => processBatchedParams(param)).flat();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use flatMap directly instead of chaining map and flat ?

@n1ru4l
Copy link
Collaborator

n1ru4l commented Mar 20, 2024

Lets make this a draft? Or do we want to ship this? We have no real-world use-case..

@kamilkisiela
Copy link
Collaborator

Let's not merge it yet, if so, it should be at least behind a feature flag and marked as experimental.

@n1ru4l n1ru4l marked this pull request as draft March 20, 2024 15:59
@ardatan
Copy link
Member Author

ardatan commented Mar 20, 2024

I agree with @kamilkisiela . It should be behind a flag at least because it conflicts with graphql-http compliance tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants